//
//  InLandCityViewController.m
//  旅游咨询
//
//  Created by 高建 on 15/4/14.
//  Copyright (c) 2015年 xubin. All rights reserved.
//

#import "InLandCityViewController.h"

@interface InLandCityViewController ()

@end

@implementation InLandCityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"国内城市";
  
    
    
    UICollectionViewFlowLayout *flowLayOut = [[UICollectionViewFlowLayout alloc]init];
    flowLayOut.itemSize = CGSizeMake(WidthZ * 0.432, WidthZ * 0.432);
    flowLayOut.sectionInset = UIEdgeInsetsMake(WidthZ * 0.0533333, HeighZ *0.03, WidthZ * 0.0265, HeighZ *0.03);
    flowLayOut.scrollDirection = UICollectionViewScrollDirectionVertical;
    flowLayOut.minimumInteritemSpacing = 5;
    
    flowLayOut.headerReferenceSize = CGSizeMake(WidthZ * 0.53333, WidthZ * 0.53333);
    
    
    //集合视图
    self.myCollectionView = [[UICollectionView alloc] initWithFrame:[[UIScreen mainScreen]bounds] collectionViewLayout:flowLayOut];
    [self.view addSubview:self.myCollectionView];
    self.myCollectionView.backgroundColor = [UIColor whiteColor];
   self.myCollectionView.delegate = self;
    self.myCollectionView.dataSource = self;
    [self.myCollectionView release];
    [[MyBaseHandle shareDataBaseHandle]openDB];
    
    self.inLandCityArray = [[MyBaseHandle shareDataBaseHandle] selectInLand];
    //注册cell
    [self.myCollectionView registerClass:[InLandCityCollectionViewCell class] forCellWithReuseIdentifier:@"reuse"];
    [self.myCollectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"header"];
    
    
    [MyAFNData getNetData:@"http://api.breadtrip.com/destination/index_places/8/" responseGETData:^(id data) {
        self.inLandCityArray = [NSMutableArray array];
        
        NSMutableArray *array = [data objectForKey:@"data"];
        [[MyBaseHandle shareDataBaseHandle]deleteInLandCity];
        [[MyBaseHandle shareDataBaseHandle]createDB];
        
        
        for (NSMutableDictionary *InLandDic in array) {
            InLandCityModel *myCityModel = [[InLandCityModel alloc] init];
            [myCityModel setValuesForKeysWithDictionary:InLandDic];
            [[MyBaseHandle shareDataBaseHandle] insertInLandCity:myCityModel];
            [self.inLandCityArray addObject:myCityModel];
            [myCityModel release];
            
        }
        [self.myCollectionView reloadData];
        
    }];
    
    
    
    
}
//设置表头
-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
    //如果是表头区域 kind 是区域类型
    
    //注意注册cell
    
    UICollectionReusableView *resuableView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"header" forIndexPath:indexPath];
    
    InLandCityView *imagView = [[InLandCityView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, HeighZ * 0.3)];
    imagView.backgroundColor = [UIColor blackColor];
    NSMutableArray *imageArray = [NSMutableArray array];
    for (int imageCount = 0; imageCount < 4; imageCount++) {
        [imageArray addObject:[NSString stringWithFormat:@"image0%d.png",imageCount + 1]];
    }
    [imagView setArrOfImages:imageArray];
    [resuableView addSubview:imagView];
    [imagView release];
        return resuableView;
     
    
}
//显示item上的内容
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    InLandCityCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"reuse" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor whiteColor];
    cell.cityNameLabel.textColor = [UIColor whiteColor];
    //改变边框形状
    cell.cityImageView.layer.masksToBounds = YES;
    cell.cityImageView.layer.cornerRadius = 7;
    
    InLandCityModel *InLandCity = [self.inLandCityArray objectAtIndex:indexPath.row];
    cell.myInLandCity = InLandCity;
    


    
    return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    
    InLandCityDetailViewController *cityDetail = [[InLandCityDetailViewController alloc] init];
    //push到下一页时隐藏tabbar
    
    cityDetail.MyInLand = [self.inLandCityArray objectAtIndex:indexPath.row];
    cityDetail.hidesBottomBarWhenPushed = YES;
    if (indexPath.row == 0) {
        NSString *XiaMenUrl = @"http://api.breadtrip.com/destination/place/3/62/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *XiaMenMissUrl = @"http://breadtrip.com/mobile/destination/3/62/intro/";
        NSString *XiaMenNeedUrl = @"http://breadtrip.com/mobile/destination/3/62/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/62/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/62/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/62/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = XiaMenMissUrl;
        cityDetail.NeedButtonUrl = XiaMenNeedUrl;
        cityDetail.url = XiaMenUrl;
    }else if (indexPath.row == 1){
        NSString *ChenDuUrl = @"http://api.breadtrip.com/destination/place/3/48/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *ChenDuMissUrl = @"http://breadtrip.com/mobile/destination/3/48/intro/";
        NSString *ChenDuNeedUrl = @"http://breadtrip.com/mobile/destination/3/48/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/48/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/48/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/48/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = ChenDuMissUrl;
        cityDetail.NeedButtonUrl = ChenDuNeedUrl;
        cityDetail.url = ChenDuUrl;
    }else if (indexPath.row == 2){
        NSString *HangZhouUrl = @"http://api.breadtrip.com/destination/place/3/26/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *HangZhouMissUrl = @"http://breadtrip.com/mobile/destination/3/26/intro/";
        NSString *HangZhouNeedUrl = @"http://breadtrip.com/mobile/destination/3/26/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/26/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/26/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/26/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = HangZhouMissUrl;
        cityDetail.NeedButtonUrl = HangZhouNeedUrl;
        
        cityDetail.url = HangZhouUrl;
    }else if (indexPath.row == 3){
        NSString *XiAnUrl = @"http://api.breadtrip.com/destination/place/3/117/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/117/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/117/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/117/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/117/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/17/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = XiAnUrl;
    }else if (indexPath.row == 4){
        NSString *ShangHaiUrl = @"http://api.breadtrip.com/destination/place/3/12/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/12/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/12/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/12/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/12/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/12/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = ShangHaiUrl;
    }else if (indexPath.row == 5){
        NSString *SanYaUrl = @"http://api.breadtrip.com/destination/place/3/205/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/205/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/205/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/205/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/205/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/205/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = SanYaUrl;
    }else if (indexPath.row == 6){
        NSString *LiJiangUrl = @"http://api.breadtrip.com/destination/place/3/110/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/110/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/110/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/110/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/110/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/110/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = LiJiangUrl;
    }else if (indexPath.row == 7){
        NSString *LaSaUrl = @"http://api.breadtrip.com/destination/place/3/508/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/508/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/508/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/508/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/508/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/508/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = LaSaUrl;
    }else if (indexPath.row == 8){
        NSString *QingDaoUrl = @"http://api.breadtrip.com/destination/place/3/131/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/131/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/131/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/131/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/131/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/131/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = QingDaoUrl;
    }else if (indexPath.row == 9){
        NSString *NanJingUrl = @"http://api.breadtrip.com/destination/place/3/14/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/14/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/14/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/14/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/14/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/14/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = NanJingUrl;
    }else if (indexPath.row == 10){
        NSString *HaErBinUrl = @"http://api.breadtrip.com/destination/place/3/198/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/198/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/198/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/198/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/198/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/198/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = HaErBinUrl;
    }else if (indexPath.row == 11){
        NSString *KunMingUrl = @"http://api.breadtrip.com/destination/place/3/72/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/72/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/72/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/72/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/72/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/72/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = KunMingUrl;
    }else if (indexPath.row == 12){
        NSString *GuangZhouUrl = @"http://api.breadtrip.com/destination/place/3/61/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/61/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/61/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/61/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/61/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/61/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = GuangZhouUrl;
    }else if (indexPath.row == 13){
        NSString *DaLianUrl = @"http://api.breadtrip.com/destination/place/3/15/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/15/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/15/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/15/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/15/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/15/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = DaLianUrl;
    }else if (indexPath.row == 14){
        NSString *DaliUrl = @"http://api.breadtrip.com/destination/place/3/15/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/108/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/108/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/108/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/108/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/108/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = DaliUrl;
    }else if (indexPath.row == 15){
        NSString *BeiJingUrl = @"http://api.breadtrip.com/destination/place/3/1/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/1/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/1/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/1/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/1/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/1/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = BeiJingUrl;
    }else if (indexPath.row == 16){
        NSString *WuHanUrl = @"http://api.breadtrip.com/destination/place/3/79/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/79/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/79/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/79/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/79/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/79/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = WuHanUrl;
    }else if (indexPath.row == 17){
        NSString *ChangShaUrl = @"http://api.breadtrip.com/destination/place/3/69/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/69/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/69/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/69/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/69/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/69/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = ChangShaUrl;
    }else if (indexPath.row == 18){
        NSString *SuZhouUrl = @"http://api.breadtrip.com/destination/place/3/13/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/13/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/13/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/13/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/13/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/13/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = SuZhouUrl;
    }else if (indexPath.row == 19){
        NSString *TianJinUrl = @"http://api.breadtrip.com/destination/place/3/11/pois/sights/?start=0&count=20&sort=default&shift=false&latitude=38.88266356313796&longitude=121.53966915009306";
        NSString *MissUrl = @"http://breadtrip.com/mobile/destination/3/11/intro/";
        NSString *NeedUrl = @"http://breadtrip.com/mobile/destination/3/11/overview/";
        NSString *firstPhoto = @"http://api.breadtrip.com/destination/place/3/11/photos/?start=0&count=21&gallery_mode=true";
        NSString *hotelUrl = @"http://api.breadtrip.com/destination/place/3/11/pois/hotel/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        NSString *restaurantUrl = @"http://api.breadtrip.com/destination/place/3/11/pois/restaurant/?start=0&count=20&sort=default&shift=false&latitude=38.8826495629487&longitude=121.53969115009306";
        cityDetail.myhotelUrl = hotelUrl;
        cityDetail.myRestaurantUrl = restaurantUrl;
        cityDetail.FirstPhotoUrl = firstPhoto;
        cityDetail.MissButtonUrl = MissUrl;
        cityDetail.NeedButtonUrl = NeedUrl;
        cityDetail.url = TianJinUrl;
    }
    
    
    [self.navigationController pushViewController:cityDetail animated:YES];
}


-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return self.inLandCityArray.count;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
